﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Sbook.Control.Menu
{
    public partial class Menu_News : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindMenu();
            }
        }

        private void BindMenu()
        {
            //List<Data.NewsGroup> list = Business.NewsGroupService.NewsGroup_GetByTop("","gStatus=1","GroupName");
            //for (int i = 0; i < list.Count; i++)
            //{
            //    //"<a href=\"/onsoft-new/" + list[i].Tag + ".htm\"><img src=\"" + list[i].Image + "\" alt=\"" + list[i].Name + "\"> </a>";
            //    ltrMenuNews.Text += "<a class=\"Group\" href=\"/News/" + list[i].GroupID + "/"+list[i].GroupName+".aspx\">"+list[i].GroupName+"</a><br />";
            //}
            List<Data.NewsGroup> list = Business.NewsGroupService.NewsGroup_GetByTop("", "gStatus=1", "GroupName");
            dtlGroup.DataSource = list;
            dtlGroup.DataBind();
        }
    }
}